﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FineSoft.Models
{
	public abstract class Object : Model, System.Runtime.Serialization.ISerializable
	{
		public virtual Class Type { get; set; }

		public abstract string ConfigsString { get; }

		public virtual string ConfigsStringInEditor
		{
			get
			{
				return this.ConfigsString;
			}
		}

		public Object()
		{
		}

		#region ISerializable 成员

		public Object(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
		{
			this.Type = InitialData.Classes[info.GetInt32("Type")];
		}

		public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
		{
			info.AddValue("Type", this.Type.Index);
		}

		#endregion
	}
}
